package com.yunyao.common.dto;

import com.yunyao.common.web.util.StringUtils;
import lombok.Data;

/**
 * @author chenyejian
 * @Date 2024/9/6 19:31
 */

/**
 * [{"fileUrl": "https://project-ycerp.oss-cn-hangzhou.aliyuncs.com/upload/20240324/98e7f65aabcfd040a6a3acd1ffaa708f.xlsx",
 * "fileOriginName": "计算器导入模板.xlsx"}]
 */
@Data
public class FileDto {
    String fileUrl;
    String fileOriginName;
    String fileSuffix;


    public FileDto(String fileOriginName,String fileUrl) {
        this.fileUrl = fileUrl;
        this.fileOriginName = fileOriginName;
        if (StringUtils.isNotEmpty(fileOriginName)) {
            this.fileSuffix = fileOriginName.substring(fileOriginName.lastIndexOf("."));
        }
    }

    public FileDto() {
    }
}
